package com.cloudkinto.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import java.util.Date;
import java.io.Serializable;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 库存流水
 * </p>
 * @author hua
 * @since 2024-11-28
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("t_product_stock_flowing")
public class ProductStockFlowingDo extends Model<ProductStockFlowingDo> {

    private static final long serialVersionUID=1L;

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    @TableField(value = "create_by", fill = FieldFill.INSERT)
    private Long createBy;

    /**
     * sku或者箱类号
     */
    @TableField("sku")
    private String sku;

    /**
     * 自定义箱条码
     */
    @TableField("customize_barcode")
    private String customizeBarcode;

    /**
     * 0退货库存 1产品库存 2箱库存(按箱类号) 3箱唛库存 按箱唛
     */
    @TableField("type")
    private Integer type;

    /**
     * 公司
     */
    @TableField("company_id")
    private Long companyId;

    @TableField("warehouse_id")
    private Long warehouseId;
    /**
     * 库位
     */
    @TableField("rack_id")
    private Long rackId;

    /**
     * 库存属性 0正品 1次品
     */
    @TableField("stock_attribute")
    private Integer stockAttribute;

    /**
     * 剩余批次库存，批次 = 使用库存当天入库库存
     */
    @TableField("close_batch_qty")
    private Integer closeBatchQty;


    /**
     * 剩余总库存
     */
    @TableField("close_qty")
    private Integer closeQty;

    @TableField("close_good_qty")
    private Integer closeGoodQty;
    /**
     * 变化量
     */
    @TableField("book_quantity")
    private Integer bookQuantity;

    /**
     * 单据类型
     */
    @TableField("order_type")
    private String orderType;

    /**
     * 关联单据号
     */
    @TableField("note_no")
    private String noteNo;

    @TableField("inner_batch_no")
    private String innerBatchNo;

    /**
     * 备注
     */
    @TableField("tips")
    private String tips;

    @TableField("tenant_id")
    private Long tenantId;

    @TableField("delete_flag")
    @TableLogic
    private Integer deleteFlag;

    @Override
    protected Serializable pkVal() {
        return this.id;
    }

}
